
<ion-view view-title="企业通讯录" class="contacts">
    <ion-header-bar class="bar-subheader">
        <div class="pick-button-bar-wrapper">
            <div class="pick-button-bar">
                <button class="button" ng-class="{'button-active':data.pickScope}" ng-click="activeScope(true)">我的部门</button>
                <button class="button" ng-class="{'button-active':!data.pickScope}" ng-click="activeScope(false)">我的好友</button>
            </div>
        </div>
        <search-bar class="search" placeholder="姓名 电话 邮箱 部门" search="data.search"></search-bar>
    </ion-header-bar>
    <ion-content scroll="false">
        <chat-scroll delegate-handle="chatScroll" quick-cambers="data.quickCambers" 
                    active-camber="data.activeCamber">
            <chat-group ng-repeat="contact in data.contacts" title="{{contact.group}}" class="chat">
                <ion-list>
                    <ion-item ng-repeat="item in contact.items"
                          class="chat-box" ng-click="goDetail(item.id)">
                        <img ng-src="{{item.photo || 'img/default-avatar.png'}}">
                        <span>{{item.name}}</span>
                        <span class="department">{{item.department}}</span>
                        <img class="fn-img fn-call" src="img/icon_call.png" ng-click="call(item.tel, $event)">
                        <img class="fn-img fn-message" src="img/icon_message.png" ng-click="sendMsg(item.tel, $event)">
                        <ion-option-button ng-if="data.pickScope===false" class="ion-ios-trash option-delete" ng-click="manageFriend(item.id, false, $event)"></ion-option-button>
                        <ion-option-button ng-if="data.pickScope===true" class="ion-ios-personadd option-add" ng-click="manageFriend(item.id, true, $event)"></ion-option-button>
                    </ion-item>
                </ion-list>
            </chat-group>
        </chat-scroll>
    </ion-content>
</ion-view>